function findParent {
	local i
	for ((i=0; i<${#res[@]}; i+=3)); do
		if [ ${res[$i]} -eq $1 ]; then
			echo -n ${res[$(($i+2))]} --
			findParent ${res[$(($i+1))]}
		fi
	done
}
res=(`ps -eo pid= -o ppid= -o comm=`)
for ((i=0; i<${#res[@]}; i+=3)); do
	echo -n ${res[$(($i+2))]} --
	findParent ${res[$(($i+1))]}
	echo nobody
done

